﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using COM.OA.Entity;
using COM.OA.BLL;
using System.Collections.Generic;

public partial class qs_wenjian_jieshouwenjian : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) 
        {
            //取当前登录人名默认哈哈 
            users loginuser = Session["loginuser"] as users;
            if (loginuser == null)
            {
                this.Response.Write(string.Format(GetRedirect.REDIRECT, "../login.aspx"));
            }
            else
            {
                int userId =loginuser.u_id;



                //string name = "haha";
                //string where1 = "u_username='{0}'";
                //where1 = string.Format(where1, name);
                //IList<users> listuname = usersBLL.Select(where1);
                //users user = listuname[0];
                

                string where2 = "f_takeu_id='{0}'";
                where2 = string.Format(where2, userId);
                IList<files> listwenjin = filesBLL.Select(where2);




                this.gdvCaoZuo.DataSource = listwenjin;
                this.gdvCaoZuo.DataBind();

            }
        }
        


    }

    protected string GetUserName(object ofaid)
    {
        int faid = Convert.ToInt32(ofaid);
        COM.OA.Entity.users us = COM.OA.BLL.usersBLL.Select(faid);
        return us.u_username;
    }

    //protected string panduan(object oisreturn) 
    //{
    //    int isreturn = Convert.ToInt32(oisreturn);
    //    string zi = "";
    //    if (isreturn == 0) 
    //    {
    //        zi="无";
           
    //    }
    //    else if (isreturn == 1) 
    //    {
    //        zi = "有";
           
    //    }
    //    return zi;

    //}


    protected void gdvCaoZuo_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Attributes["onmouseover"] = "orgColor=this.style.backgroundColor;this.style.backgroundColor='#D5EEBB';";
            e.Row.Attributes["onmouseout"] = "this.style.backgroundColor=orgColor;";
        }
    }
}
